package com.dingding.service.user.core.order.sql;

public class OrderUserSQL {

	/**
	 *
	 * 订单推送获取所有在线用户的相关信息
	 * @author CHEHUANBO
	 * @since V2.4.0
	 * 
	 * 
	 */
	public static final String GET_PUSH_USER_INFO(int userType) {

		String sql = "SELECT ul.aliasId,ul.loginEquipment,ul.pushNumber,ul.uid FROM userlogin ul INNER JOIN userdetail ud ON ul.uid = ud.loginId INNER JOIN userpushsetting us ON ul.uid = us.loginId WHERE ul.userStatus = 1 AND ud.currentCity LIKE ? AND us.orderReminder = 1 AND ul.uid != ?";

		if (userType == 1) { // 司机下单
			sql += " AND ul.userRole in (1,2) ";
		} else if (userType == 2) { // 乘客下单
			sql += (" AND ul.userRole in (1)");
		}

		return sql;

	}

}
